<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="common/include :: header('请假申请')" />
</head>
<body>

<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-leave-edit" >
        <input name="bpmnInfoId" th:value="${bpmnInfo!=null?bpmnInfo.id:''}" type="hidden" >

        <div class="form-group">
            <label class="col-sm-3 control-label">申请人：</label>
            <div class="col-sm-8">
                <input name="name" class="form-control" type="text" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">原因：</label>
            <div class="col-sm-8">
                <input name="reason" class="form-control" type="text" >
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">开始时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="starttime" class="form-control timerange" placeholder="yyyy-MM-dd HH:mm" type="text" required>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">结束时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="endtime" class="form-control timerange" placeholder="yyyy-MM-dd HH:mm" type="text" required>
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">审核流程：</label>
            <div class="col-sm-8">
                <input name="bpmnInfoId" th:value="${bpmnInfo!=null?bpmnInfo.bpmnName:''}" class="form-control" type="text" readonly disabled="disabled">
            </div>
        </div>
        <div class="form-group" id="directorId">
            <label class="col-sm-3 control-label">审核人(部门经理)：</label>
            <div class="col-sm-8">
                <select name="director" class="form-control m-b" readonly>
                    <option th:each="u : ${directors}" th:text="${u.userName}" th:value="${u.id}"></option>
                </select>
            </div>
        </div>
        <div class="form-group" id="financeId">
            <label class="col-sm-3 control-label">审核人(人事)：</label>
            <div class="col-sm-8">
                <select name="finance" class="form-control m-b" readonly>
                    <option th:each="u : ${finances}" th:text="${u.userName}" th:value="${u.id}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注信息：</label>
            <div class="col-sm-8">
                <textarea name="info" class="form-control"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="common/include :: footer" />
<th:block th:include="common/include :: datetimepicker" />
<script type="text/javascript">
    var prefix = ctx + "/business/leave";

    $(".timerange").datetimepicker({
        format: "yyyy-mm-dd hh:mm:ii",
        autoclose: true
    });
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/startAudit", $('#form-leave-edit').serialize());
        }
    }


</script>
</body>
</html>